﻿using LY.DataAccess.Repository;
using LY.Entity;
using LY.Entity.Entities;
using LY.Entity.PageSearch;
using LY.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LY.Business.ServiceImpl
{
    class MessagesService : IMessagesService
    {
        MessagesRepository _messages;

        public MessagesService()
        {
            _messages = new MessagesRepository();
        }
        //添加私信信息
        public int SaveMessages(U_Messages Messages)
        {
            //执行新增操作
            return (int)_messages.Insert(Messages);
        }


        public PagedList<U_Messages_EX> MyMessageLink(int id, PageView view)
        {
            return _messages.MyMessageLink(id, view);
        }


        public List<U_Messages_EX> MyMessageDetail(string m_id, string r_id)
        {
            return _messages.MyMessageDetail(m_id, r_id);
        }


        public int AddMessages(U_Messages msg)
        {
            return (int)_messages.Insert(msg);
        }


        public int UpdateMessageStatus(string id)
        {
            return _messages.UpdateMessageStatus(id);
        }


        public int IsNameExists(string name)
        {
            return _messages.IsNameExists(name);
        }


        public int DeleteMessage(string mid,string rmid)
        {
            return _messages.DeleteMessage(mid,rmid);
        }
    }
}
